﻿using System.Linq;
using CI.Models.Data;
using CI.Models.Production;
using CI.Models.Production.Interfaces;
using CI.ViewModels.Diagramming;

namespace CI.ViewModels
{
    public sealed class SchematicItemSelectorViewModel : InventoryItemSelectorViewModelBase
    {
        public SchematicItemSelectorViewModel(IStaticDataRepository<Item> repo, string groupName,
                                              DiagramViewModel parentViewModel)
            : base(groupName, parentViewModel)
        {
            PreFiltered = repo.All.Where(i => i.Schematic != null).AsQueryable();

            ApplyFilter();
        }
    }
}